<template>
    <div class="grandson">
        Grandson
    </div>
</template>
<script setup>
import {defineExpose} from 'vue';
const grandsonName = 'grandson'
//可以通过 defineExpose 编译器宏来显式指定在 
//<script setup> 组件中要暴露出去的属性：
defineExpose({
    grandsonName
});
</script>
<style>
.grandson{
    border:5px solid red;
    padding:10px;
}
</style>